package com.bird.user.application

import com.bird.user.application.converter.toUserEntity
import com.bird.user.application.pl.UserRegisterRequest
import com.bird.user.domain.UserHandler
import org.springframework.stereotype.Service

@Service
class UserCommandService(val userHandler: UserHandler) {

    /**
     * 用户注册
     */
    fun register(userRegisterRequest: UserRegisterRequest) {
        // 转换为领域实体
        val userEntity = userRegisterRequest.toUserEntity()
        // 调用领域服务，注册用户
        userHandler.register(userEntity)
    }


}